class CQueue {
public:
    CQueue() {
    }

    stack<int> stAppendTail;  //用于存储入队的数据
    stack<int> stDeleteHead;  //用于存储出队的数据
    
    void appendTail(int value) {
        stAppendTail.push(value);  //入队
    }
    
    int deleteHead() {
        //若stDeleteHead为空，则需将stAppendTail中数据全部压入stAppendTail中
        //若是stAppendTail也为空，则代表队中无数据，返回-1
        if(stDeleteHead.empty()){
            if(stAppendTail.empty()) return -1;
            while(!stAppendTail.empty()){
                stDeleteHead.push(stAppendTail.top());
                stAppendTail.pop();
            }
        }

        int stDeleteHeadTop = stDeleteHead.top();
        stDeleteHead.pop();
        return stDeleteHeadTop;
    }
};

/**
 * Your CQueue object will be instantiated and called as such:
 * CQueue* obj = new CQueue();
 * obj->appendTail(value);
 * int param_2 = obj->deleteHead();
 */